package com.aki.ai_property.controller;

import com.aki.ai_property.entity.Householder;
import com.aki.ai_property.service.intf.HouseholderService;
import com.aki.ai_property.vo.PageBean;
import com.aki.ai_property.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ━━━━━━永无BUG!━━━━━━
 *
 * @author AKI
 * @date 2022/8/27
 */
@RestController
@RequestMapping("/api/householder/")
public class HouseholderController {
    @Autowired
    private HouseholderService service;

    @PostMapping("save.do")
    public Result save(Householder householder){
        return service.save(householder);
    }

    @PostMapping("update.do")
    public Result update(Householder householder){
        return service.update(householder);
    }
    @GetMapping("page.do")
    public PageBean page(String name,int page,int limit){
        return service.selectPage(name,page,limit);
    }
    @GetMapping("all.do")
    public Result all(){
        return service.all();
     }

//    @GetMapping("all1.do")
//    public Result all1(){
//        return service.all();
//    }
    @GetMapping ("sextj.do")
    public Result sextj(){
        System.out.println(service.sextj());
        return service.sextj();
    }
}
